[#ftl]
[#if enclose]
[#if graphqlFunction.mode.name()=="QUERY"]query[#else]mutation[/#if] ${graphqlFunction.name}[#if graphqlFunction.arguments?size gt 0]([#list graphqlFunction.arguments as arg][#if arg_index != 0],[/#if]$${arg.name}:[#if arg.list][[/#if]${arg.type}[#if arg.list][#if arg.requiredBody]![/#if]][/#if][#if arg.required]![/#if][/#list])[/#if]{
[/#if]
    ${graphqlFunction.name}[#if graphqlFunction.arguments?size gt 0]([#list graphqlFunction.arguments as arg][#if arg_index != 0],[/#if]${arg.name}:$${arg.name}[/#list])[/#if][#if graphqlFunction.queryMode??&&graphqlFunction.queryMode.name()=="OFFSET"]{
        uuid
        totalCount
        status
        pageInfo{
            page
            size
            offset
            endCursor
            hasNextPage
        }
        edges{
            node[#if !isScalar(graphqlFunction.type)][@type name=graphqlFunction.type level=3/][/#if]
        }
    }
[#else]
    [#if !isScalar(graphqlFunction.type)][@type name=graphqlFunction.type level=1/][/#if]
[/#if]
[#if enclose]

}
[/#if]

[#macro type name level]{
[#list getType(namespace,name).fields as f][#if level<=(deepLevel!5)||isScalar(f.type)][#list 0..level as l]${"    "}[/#list]${f.name}[#if !isScalar(f.type)][@type name=f.type level=level+1/][/#if][/#if]
[/#list][#list 0..level-1 as l]${"    "}[/#list]}
[/#macro]
